#define _CRT_SECURE_NO_WARNINGS
int maxProfit1(int* prices, int pricesSize)
{
    int i = 0;
    int j = 0;
    int k = 0;
    for (i = 0; i < pricesSize; i++)
    {
        for (j = i + 1; j < pricesSize; j++)
        {
            if (prices[j] - prices[i] > k)
            {
                k = prices[j] - prices[i];
            }
        }
    }
    return k;
}
int maxProfit2(int* prices, int pricesSize)
{
    int min = 1000000, max = 0;
    for (int i = 0; i < pricesSize; i++)
    {
        if (prices[i] < min)
        {
            min = prices[i];
        }
        if (prices[i] - min > max)
        {
            max = prices[i] - min;
        }
    }
    return max;
}
int main()
{
    int prices[6] = { 9,3,12,1,2,3 };
    return 0;
}